package data;

import java.sql.SQLException;
import java.util.List;

import jdbmaplite.manager.ParseConfigException;
import jdbmaplite.manager.impl.JDBMapLiteManager;
import jdbmaplite.mapper.impl.JDBMapLiteDao;

public class UserDao extends JDBMapLiteDao {

	/**
	 * Default constructor.
	 */
	public UserDao(JDBMapLiteManager dbManager) throws ParseConfigException {
		super(dbManager);
	}

	/**
	 * Get User
	 */
	public User getUser(String userId) throws SQLException {
		return this.executeQuery(userId);
	}

	/**
	 * Get Users
	 */
	public List<User> getUsers() throws SQLException {
		return this.executeBulkQuery();
	}

	/**
	 * Update User
	 */
	public void updateUser(String userId, String userName) throws SQLException {
		this.executeUpdate(userId, userName);
	}

	/**
	 * Create User
	 */
	public void createUser(User user) throws SQLException {
		this.executeObjectUpdate(user);
	}

}